#include<stdio.h>
#include<string.h>
int f(int n,int a[])
{  
int count=0;
	for(int i=0;n>0;i++)
	{
		if(n<2)  
			a[i]=n;
		else
		{
			a[i]=n%2;
		}
		n=n/2;
	count++;
	//	f(n/2,a);
	}
	return count;
}
int main()
{
	 int n,b;
	while(scanf("%d",&n)!=EOF){
		
	int y=0;
	int a[64];
	b=f(n,a);
	for(int i=0;i<b;i++)
	{
		if(a[i]==1)
		y++;
	}
	printf("%d\n",y);
}
	return 0;
}
